package com.yylending.las.lending.quota.entity;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * 个人基本信息
 * Created by laixj on 2016/11/15.
 * Copyright © 2016 www.yyfax.com. All Rights Reserved.
 */

public class PersonalBean implements Parcelable{

    public String title;
    public String education;
    public String hasHouse;
    public String workType;
    public String marriage;
    public String living;
    public String dept;
    public String company;
    public String addP;
    public String addC;
    public String addD;

	/*address true string 居住地址
	workType true number 1:受薪，2:自雇
	hasHouse true number 1:无，2:有
	marriage true number 1:未婚，2:已婚
	education true number 1:硕士及以上，2:本科，3:大专，4:高中/中专，5:初中及以下
	living true number 1:自建，2:自购无贷款，3:自购有贷款，4:租用，5:亲属住房，6:单位住房，7:其他
	company true string 所在企业名称
	dept true string 所在部门
	title true string 职位*/

    public String getAddress() {
		return (addP ==null?"": addP)+" " +(addC ==null?"": addC)+" " +(addD ==null?"": addD);
    }

	@Override
	public String toString() {
		return "PersonalBean{" +
				"title='" + title + '\'' +
				", education='" + education + '\'' +
				", hasHouse='" + hasHouse + '\'' +
				", workType='" + workType + '\'' +
				", marriage='" + marriage + '\'' +
				", living='" + living + '\'' +
				", dept='" + dept + '\'' +
				", company='" + company + '\'' +
				", addP='" + addP + '\'' +
				", addC='" + addC + '\'' +
				", addD='" + addD + '\'' +
				'}';
	}


	public PersonalBean() {
	}

	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeString(this.title);
		dest.writeString(this.education);
		dest.writeString(this.hasHouse);
		dest.writeString(this.workType);
		dest.writeString(this.marriage);
		dest.writeString(this.living);
		dest.writeString(this.dept);
		dest.writeString(this.company);
		dest.writeString(this.addP);
		dest.writeString(this.addC);
		dest.writeString(this.addD);
	}

	protected PersonalBean(Parcel in) {
		this.title = in.readString();
		this.education = in.readString();
		this.hasHouse = in.readString();
		this.workType = in.readString();
		this.marriage = in.readString();
		this.living = in.readString();
		this.dept = in.readString();
		this.company = in.readString();
		this.addP = in.readString();
		this.addC = in.readString();
		this.addD = in.readString();
	}

	public static final Creator<PersonalBean> CREATOR = new Creator<PersonalBean>() {
		@Override
		public PersonalBean createFromParcel(Parcel source) {
			return new PersonalBean(source);
		}

		@Override
		public PersonalBean[] newArray(int size) {
			return new PersonalBean[size];
		}
	};
}
